package Text01;

public class Person {
    private int age;

    public void setAge(int age) {
        if (age >= 0 && age <= 100){
            this.age = age;
        }else {
            System.out.println("不合格");
        }
    }



    public int getAge() {

        if(age>=0 && age<100){
            return age;
        }else{
            return -1;
        }
    }
}


